<%@ page import="framework.common.Common" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
    <meta charset="utf-8">
    <title>牛皮</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <!-- 引入框架的js、css等 -->
    <jsp:include page="${request.contextPath}/static/include.jsp" flush="true" />
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/modal.css?ver=<%=System.currentTimeMillis()%>" /> <%-- 模态框的css --%>

    <script type="text/javascript">
        //一般直接写在一个js文件中
        layui.use([ 'form', 'layer'], function() {
            var form = layui.form
                ,$ = layui.jquery;

            verifyExt(form);
            form.on('submit(*)', function(data){ //form校验成功才会执行下面的代码
                //怎么刷新树状table
                ajax("/framework/SysFileModule.do?method=update", serializeObject($("#bofrom")));
                return false; //禁用form表单自带的提交
            });

            //初始化“是否为多文件上传”选项
            _get("/framework/sysCodesetDetail.do?method=listByCodesetEnname", {enName: "isStatus"})
                .then(response => {
                    _initRadioItem(form, "#radio_isMultiple", response.data, "isMultiple", "${bo.isMultiple}");
                })
                .catch(err => { console.error(err) });
        });

    </script>
</head>

<body class="childBody">
<form id="bofrom" class="layui-form">
    <%-- 主键, 父部门主键 --%>
    <input type="hidden" name="lid" value="${bo.lid}">

    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span>表名</label>
        <div class="layui-input-block">
            <input type="text" name="tableName" value="${bo.tableName}" class="layui-input" lay-verify="required">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span>模块英文名</label>
        <div class="layui-input-block">
            <input type="text" name="moduleEname" value="${bo.moduleEname}" class="layui-input" lay-verify="required">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span>模块中文名</label>
        <div class="layui-input-block">
            <input type="text" name="moduleCname" value="${bo.moduleCname}" class="layui-input" lay-verify="required">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span>是否为多文件上传</label>
        <div class="layui-input-block" id="radio_isMultiple">
            <%-- 自动生成选项 --%>
        </div>
    </div>

    <!--隐藏的提交按钮，提供父页面调用  -->
    <div class="layui-form-item" style="display: none;">
        <div class="layui-input-inline">
            <button class="layui-btn form-submit-btn" lay-submit="" lay-filter="*">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</body>
</html>
